import {NgModule} from '@angular/core';
import {Routes, RouterModule} from '@angular/router';
import {HellowordComponent} from './helloword/helloword.component';
import {LayoutComponent} from '../layout/layout.component';
import {SearchEnginesComponent} from './utils/search-engines/search-engines.component';
import {TranslateComponent} from './utils/translate/translate.component';
import {GlobeComponent} from './special-effects/globe/globe.component';
import {CompassClockComponent} from './special-effects/compass-clock/compass-clock.component';
import {TaiChiComponent} from './special-effects/tai-chi/tai-chi.component';
import {FigureComponent} from './special-effects/figure/figure.component';
import {CalculatorComponent} from './utils/calculator/calculator.component';


const routes: Routes = [
    {
        path: '',
        component: LayoutComponent,
        children: [
            {
                path: 'utils',
                loadChildren: './utils/utils.module#UtilsModule',
                children: [
                    {
                        path: 'search',
                        component: SearchEnginesComponent
                    },
                    {
                        path: 'translate',
                        component: TranslateComponent
                    },
                    {
                        path: 'calculator',
                        component: CalculatorComponent
                    }
                ]
            },
            {
                path: 'specialEffects',
                loadChildren: './special-effects/special-effects.module#SpecialEffectsModule',
                children: [
                    {
                        path: 'globe',
                        component: GlobeComponent
                    },
                    {
                        path: 'clock',
                        component: CompassClockComponent
                    },
                    {
                        path: 'taiChi',
                        component: TaiChiComponent
                    },
                    {
                        path: 'figure',
                        component: FigureComponent
                    }
                ]
            }
        ]
    }
];

@NgModule({
    imports: [
        RouterModule.forChild(routes)
    ],
    exports: [RouterModule],
    declarations: [HellowordComponent]
})
export class PagesRoutingModule {
}
